//
//  MyStock.m
//  Stock
//
//  Created by blacksun on 11-6-16.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "MyStock.h"


@implementation MyStock

@synthesize uuid;
@synthesize name;
@synthesize lastClosingPrice;
@synthesize openingPrice;
@synthesize closingPrice;
@synthesize changedPrice;
@synthesize changedRate;
@synthesize turnover;
@synthesize turnoverMoney;
@synthesize maxPrice;
@synthesize minPrice;
@synthesize tc;
@synthesize dc;
@synthesize dateTime;
@synthesize ff;
@synthesize ft;
@synthesize cn;
@synthesize cr;
@synthesize mh;
@synthesize pr;

@synthesize cnDifference;
@synthesize crDifference;
@synthesize mhDifference;
@synthesize prDifference;
@synthesize currentRate;

-(void)dealloc{
    [uuid release];
    [name release];
    [lastClosingPrice release];
    [openingPrice release];
    [closingPrice release];
    [changedRate release];
    [changedPrice release];
    [turnover release];
    [turnoverMoney release];
    [maxPrice release];
    [minPrice release];
    [tc release];
    [dateTime release];
    [ft release];
    [ff release];
    [dc release];
    [currentRate release];
    [super dealloc];
    
}

+(NSArray *)transients{
    return [NSArray arrayWithObjects:@"cnDifference",@"crDifference",@"mnDifference",@"prDifference",@"currentRate",nil];
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    NSLog(@"key:%@ not found",key);
}

-(NSInteger)countByUUID{
    NSString *criteria = [NSString stringWithFormat:@"where uuid='%@'",uuid];
    return [MyStock countByCriteria:criteria];
}
@end
